<template>
    <div>
        <el-pagination
            class="page"
            background=""
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="pageData.pagenum"
            :page-sizes="[5,10, 15]"
            :page-size="pageData.pagesize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total"
        ></el-pagination>
    </div>
</template>

<script>
export default {
    props: ["total", "", ""],
    data() {
        return {
            pageData: {
                // 当前页数
                pagenum: 1,
                // 每页显示多少数据
                pagesize: 5,
            },
        };
    },
    created() {
        this.sss();
    },
    methods: {
        sss() {
            console.log(this.total, this.pageSize, this.currentPage);
        },
        /* 向父组件发送每页显示数量 */
        handleSizeChange(newSize) {
            console.log(newSize);
            //事件传递
            this.$emit("sizeChange", newSize);
            // this.pageData.pagesize = newSize;
            // this.getUserList();
        },
        /* 向父组件发送第几页 */
        handleCurrentChange(newSize) {
            console.log(newSize);
            this.$emit("currentChange", newSize);
            // this.pageData.pagenum = newSize;
            // this.getUserList();
        },
    },
};
</script>

<style lang="sass" scoped></style>
